from urllib2 import Request, urlopen, URLError, HTTPError  

url = 'http://www.someserver.com/cgi-bin/register.cgi'  
  
user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'    
values = {'name' : 'WHY',    
        'location' : 'SDU',    
        'language' : 'Python' }    
header = {'User-Agent':user_agent}
req = Request(url,,header)   
response = urlopen(req)    
print response.read()   
